package com.woniu.service.impl;

import com.woniu.mapper.UserMapper;
import com.woniu.service.UserService;
import com.woniu.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.Set;

/**
 * @author zhaolei
 * @date 2021/4/22 - 23:04
 */
public class UserServiceImpl implements UserService {
    private UserMapper userMapper;

    public UserServiceImpl() {
        SqlSession sqlSession = MybatisUtils.createSqlSession();
        this.userMapper = sqlSession.getMapper(UserMapper.class);
    }

    @Override
    public String getPwdByUserName(String userName) {
        return this.userMapper.getPwdByUserName(userName);
    }

    @Override
    public Set<String> getRolesByUserName(String userName) {
        return this.userMapper.getRolesByUserName(userName);
    }

    @Override
    public Set<String> getPermissionsByUserName(String userName) {
        return this.userMapper.getPermissionsByUserName(userName);
    }
}
